home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-06 / binddump.zip / BINDDUMP.MNU < prev   
Text File  |  1992-05-18  |  4KB  |  168 lines

  1. Comment
  2. ==========================================================
  3.  
  4. Copyright 1992 by Marc Perkel * All right reserved.
  5.  
  6. This program dumps the bindery to the screen, printer or file. It is
  7. written in MarxMenu.
  8.  
  9. =========================================================
  10. EndComment
  11.  
  12.  
  13. Var
  14.   Objects
  15.   Obj
  16.   Prop
  17.   Ty
  18.   Values
  19.   ObjStatic
  20.   PropType
  21.   PropStatic
  22.   TypeName
  23.   TypeNumber
  24.  
  25. Qualifier
  26.   ObjName
  27.   ObjType
  28.  
  29.  
  30. OutFile = ParamStr(2)
  31.  
  32. StandardIO
  33.  
  34. if OutFile = ''
  35.    Writeln
  36.    Writeln 'Computer Tyme BindDump * Copyright 1992 by Marc Perkel'
  37.    Writeln 'All Rights Reserved * Version 1.0 * Release Date: 05-18-92'
  38.    Writeln
  39.    Writeln 'Computer Tyme * 411 North Sherman, Suite 300 * Springfield Mo. 65802'
  40.    Writeln '(800) 548-5353 Sales * (417) 866-1222 Voice * (417) 866-1665 Data'
  41.    Writeln
  42.    Writeln 'This utility will dump the contents of the NetWare bindery to a'
  43.    Writeln 'file or printer.'
  44.    Writeln
  45.    Writeln 'USAGE: BINDDUMP <file>
  46.    Writeln
  47.    Writeln 'Example:'
  48.    Writeln '  BINDDUMP BINDARY.TXT   ;output to file
  49.    Writeln '  BINDDUMP PRN           ;to print bindary
  50.    Writeln
  51.    Writeln 'Price $50 per customer. Unlimited Servers.'
  52.    Writeln 'Written in MarxMenu. Comes free with the Network Survival Kit.'
  53.    exitmenu
  54. endif
  55.  
  56. NovObjects (Objects)
  57.  
  58. SetTypeNames
  59.  
  60. Main
  61.  
  62.  
  63. Procedure Main
  64. var St ObjSecurity PropSecurity
  65.    Loop Objects
  66.       Obj = Objects[LoopIndex].ObjName
  67.       Ty = Objects[LoopIndex].ObjType
  68.       ObjSecurity = NovObjectSecurity (Obj,Ty)
  69.       if NovStaticObject (Obj, Ty)
  70.          ObjStatic = 'Static      '
  71.       else
  72.          ObjStatic = 'Dynamic     '
  73.       endif
  74.       Write PadName(Obj,31) 'Type: ' PadName(ObjType(Ty),10)
  75.       Write ' Write: ' ObjSecurity / 16 '  Read: ' ObjSecurity and 15
  76.       Writeln '  ' ObjStatic
  77.       Writeln
  78.       NovScanProperties (Prop,Obj,Ty)
  79.       Loop Prop
  80.          PropSecurity = NovPropertySecurity (Obj,Prop[LoopIndex],Ty)
  81.          if NovSetProperty (Obj, Prop[LoopIndex],Ty)
  82.             PropType = 'SET       '
  83.          else
  84.             PropType = 'ITEM      '
  85.          endif
  86.          if NovStaticProperty (Obj, Prop[LoopIndex],Ty)
  87.             PropStatic = 'Static      '
  88.          else
  89.             PropStatic = 'Dynamic     '
  90.          endif
  91.          Write PadName('   ' + Prop[LoopIndex],31) 'Type: ' PropType
  92.          Write ' Write: ' PropSecurity / 16 '  Read: ' PropSecurity and 15
  93.          Writeln '  ' PropStatic
  94.          Writeln
  95.          if NovSetProperty (Obj, Prop[LoopIndex],Ty)
  96.             NovPropertyValues(Values,Obj,Prop[LoopIndex],Ty)
  97.             Loop Values
  98.                Writeln '      ' Values[LoopIndex]
  99.             EndLoop
  100.          else
  101.             NovPropertyValues(Values,Obj,Prop[LoopIndex],Ty)
  102.             Loop Values
  103.                DumpString(Values[LoopIndex])
  104.                if LoopIndex < NumberOfElements(Values) then Writeln
  105.             EndLoop
  106.          endif
  107.          Writeln
  108.       EndLoop
  109.       Writeln
  110.    EndLoop
  111. EndProc
  112.  
  113.  
  114. Procedure PadName (St L)
  115.    while length(St) < L
  116.       St = St + ' '
  117.    endwhile
  118.    Return St
  119. EndProc
  120.  
  121.  
  122. Procedure SetTypeNames
  123.    AppendArray(TypeName,'user')
  124.    AppendArray(TypeName,'group')
  125.    AppendArray(TypeName,'queue')
  126.    AppendArray(TypeName,'server')
  127.  
  128.    AppendArray(TypeNumber,'1')
  129.    AppendArray(TypeNumber,'2')
  130.    AppendArray(TypeNumber,'3')
  131.    AppendArray(TypeNumber,'4')
  132. EndProc
  133.  
  134.  
  135. Procedure ObjType (Ty)
  136. var P St
  137.    Ty = Str(Ty)
  138.    P = PosInList(Ty,TypeNumber)
  139.    if P > 0
  140.       St = TypeName[P]
  141.    else
  142.       St = Ty
  143.    endif
  144.    Return '(' + St + ')'
  145. EndProc
  146.  
  147.  
  148.  
  149.  
  150. Procedure DumpString (St)
  151. var X St2 Ch
  152.    Loop 8
  153.       Write '      '
  154.       St2 = ''
  155.       Loop 16
  156.          X = X + 1
  157.          Ch = Mid(St,X,1)
  158.          Write HexString(ord(Ch),2) ' '
  159.          if (Ch >= ' ') and (Ch <= '~')
  160.             St2 = St2 + Ch
  161.          else
  162.             St2 = St2 + '.'
  163.          endif
  164.       endloop
  165.       Writeln '   ' St2
  166.    endloop
  167. EndProc
  168.